/* ----------------------------------------------------------------------------------------------------------------
 * Fragment
 * ----------------------------------------------------------------------------------------------------------------
 */
package pure.engine.entity 
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.display.TriangleCulling;
	import pure.engine.renderer.Renderer;
	import pure.engine.system.ns_despair;
	
	use namespace ns_despair
	
	/**
	 * @internal
	 * 
	 * 碎片(残像组件)
	 * 
	 * @author Pure
	 */
final public class Fragment extends Bitmap 
{
	public function Fragment()
	{
		super(null, 'never');
	}
	

	ns_despair var entity:Entity;
	
	ns_despair var renderer:Renderer;
	
	
	
	
	// 是否可交互
	final ns_despair function get interactive():Boolean
	{
		return entity.m_interactive && renderer.m_interactive;
	}
	
	
	// 回收
	final ns_despair function recycle():void
	{
		entity = null;
		renderer = null;
		this.bitmapData = null;
		EntityPool.recycleFragment(this);
	}

}
}